Added prefab creation function. Needs to be polished