made a class and made code compliant to google style