Small Changes, code clean up

Lots of work to polish it, but it works nicely.