code clean up, added ui controls