Fixed the code to adhere to coding guidelines