improved condition checking
removed prints