Finished algorithm just gotta figure out constructor.