Enhance inf spawn func, fixed bugs, added funcs