add back end logic and update color