Fixed the broken code, moved everything into a fresh directory