Some code cleanup, correction of the spec for proper diagonals, add diagonals