Refactored a little bit, removed sysout's