added rint function