added uistuff and a lot of other stuff