added unit tests base and some other nuance changes.