modified code for Eventbase Interview Test