moved some variables around