- (\q -> 0 <= (fst q) && (fst q) < w && (snd q) <= 0 && (snd q) < h)
- [(a-x,b-y) | a <- [x-1..x+1], b <- [y-1..y+1], not (a==x && b==y)]
+ -- (\q -> 0 <= (fst q)+x && (fst q)+x < w && (snd q)+y <= 0 && (snd q)+y < h)
+ (\q -> 0 <= (fst q)+x && (fst q)+x < w && 0 <= (snd q)+y && (snd q)+y < h)
+ [(a,b) | a <- [-1..1], b <- [-1..1], not (a==0 && b==0)]