Finished, working code uploaded. Needs to be cleaned up.