Completed the initial functioanlity

Completed the functioanlity getting all tests to pass.