improving again
memory O(WH) for fast