Removed extraneous functions and updated to version 1