cleaned up usage of bit masks: instead of (mask & option), (mask & option != NO)