Reformatting code, and changing some of the implementations.