fixed lots of ui bugs and cleanup