NOTES

1) find optimal smallest window.
2) extend to 3 or more dimensions.
