div/mod and if/else control flow