Replaced printlns with LOG calls.