removed unused variable i