More changes!

made the algorithm work a bit better, added more output at the bottom,
and a header to the class file