removed debug statements. added some documentation