Revamp of UI, fixed a few bugs