Rewrote Spawn code