added xmin and xmax