code changes following feedback