added both mask implementations
renamed for clarity