Initial Commit

Pretty ugly code, somewhat too procedural, very much a WIP.