took in shadis suggestions from code review