changed x and y for rect & matches