initial commit

Fleshing out the algorithm