Use the real power to start the engine in the gear calculation and
remove the unnecessary commands, also  improve the code readability.