removed unused function and variables