Added rest of implementation
Fully converted code