made mask use optional arg using arity rather than map destructuring
implemented accumulator
renamed files