Adding Code and unittests