added clear button, moved some ui logic to view from controller