cleaned up formatting a little in functions