revamped UI, added more backend logic