Added a few "restrict" keywords and changed some divisions to shifts