Almost done cleaning; still need to do some final checks and make able to run from command line