Finished the major functionality