Added Question3 using bitmasking