Use span instead of a, and add var where needed