moved init function to constructor of runtime, and moved runtime onto the heap