cleaned it up a bit, got rid of some code but keeping it in old-code.py just in case