added logging
working solution
correct output for working solution