Added hacky mask functionality