added mask filter, still not perfectly working with rotations