Simplified mersennes implementation