Filled out the majority of the implementation