separated things into class files, yay
added a few comments for posterity