cleaned up some function names and documentation