removed unnecessary variable copying