Completed all the functions

Don't know if it compiles on ECE machines. Error codes still need to be
added, and program needs to be tested.