cleaned up comments, reordered functions alphabetically