more cleanup and making the program actually work