first commit in a long time, all functional, cleaning up code