Take example code from PR #36 and turn it into a function. Intputs will be the 4 maps and the output will be the final mask.