More implementation of expand, almost done!