Check code style
Bugs fixed
Convert step from scala to java