CheckStyle fixes, code formatting and add comments