added cstyle implementation with tests