Edited some errors. added function call. finished function.