Tests added, and modification to write tests