Completed implementation and unit tests