Updated and added unit testing.