Completed setXLength() and setYLength() methods