removing sout's and adding proper logging