wrote index properly for reals