added diagonal traversal