trying to mimic the phonejs tip calculator demo