updated if-statement in main