write a bit code...check this out : )

complex condition can be moved into separate helper