Fixed #253, correcting variable name from i to y