added UI and fixed bugs