fixed the fretoindex method to use rounding