Updated to allow updates and added unit test