Replaced System.out with log statements.