Adopted pull requests 12 and 13 to fit the coding style