changed if from Ident to expr.
seperated if and ifElse for cleaner code :)