replaced println with log statements