The direction for NewX and NewY should use only the low 3-bits; correct that so that it is.