code cleanup
merged ui
merged ui.. again
works with gui