altered document function
removed unused function