Changed initial i to 1 as R starts from 1