removed unused variable j