Wrote down pseudo-code gist of what we want. Now I wonder if it is possible