Some Debug changes

Using debug output function instead Sys.out.println