removed unused variable and function