extend function added
implemented extend function