corrected and improved fixed point code