delete a lot i++, and add initialization of y