Got types figured out and started the algorithm implementation