Do 1-x after the modulo. Not sure why you multiply by delta twice, though. I’d do something along the lines of: