modified work to work with the modN, can cahnge bit width there