moved x, y limits to classes