Amalgamated a few functions and edits to reflect this