Fixed Memory Error in make_mask. Checked in Valgrind.
Mostly done, just need to tue parameters.