Clean up.
Working bitmask. But not perfect.