Reformatted code, and testing stuff