first pass at algorithm sketch