removing sout's and proper logging added