added progress bars, lots of restructuring