added code format/style test and fixed up code