new algorithm for n & m out of bounds + double systematics for the rest