updated with log statements