It worked as a proof of concept, but as the code itself needs to be a bit smarter, it would be a lot smarter to break up that code to make it easier to work on the individual parts.