added unit tests for existing implementation
used simple object assignment over defineProperty to support older version of IE