added helper that mapped index, first and last