Implemented spawning and unit cleanup