major changes using bitwise flags