implemented spawing mechanism