added irgen
added final argument to createBuffer