added the majority of functions, need to begin testing it now