reformatted and removed debug statements