made spawning smarter and improved various debugging features