modification for mod 4