Cleaned up formatting and documentation a little, made the function names more intuitive