refined ui, added basic loop