Removed debugging statements, added documentation