added additional documentation
fix for cleared variables