finished logic that actually updates UI