A partial implementation

Missed some functions but the structure is there.