finished implementing and added more unit tests