almost done

algorithums are done. Just need to make a counter for comparisons and
elementary operations.