improved indentation, removed dead code
improved printfs