Updated code to follow coding guidelines