Implmented sorting of rows by cordinate Y