added assign/extend function
added more tests
added more tests