Implement last to first mapping function lf(i)
add comments