Updated implementations and also almost done.
Some minor bugs to figure out.