Added better try-catches and System.out.prints