First draft of code, before I begin debugging for infinite loop. Will be chopping up code to test it