CR changes: added unit tests :P