Implementation

Need to add API docs but I'm happy otherwise.