made make_array use heap instead of stack