Working except for diagonal handling.