Finished writing code. Need to add comments and change function names.