Fixed UI and logic to work