Doing a bit of testing. Left some speed/time performance code in here, need to do more work later.