Code cleanup, fixed formatting, and comments translated in english