Attempt to organise the code better. Make it a python package that you can install