cleanup.
Code works but needs more polishing.