removed useless v_count variable and replaced it by using i loop variable