spring cleaning

deleted obsolete functions,
cleaned up formatting,
some efficiency improvements