mod3/mod4 by hand