Fixing logging (changing from System.out.println())