code beautified; applied the official coding style