DONE

Might be inefficient, improperly indented, and overall ugly. But I finished it. And it works.