Added a rectangle class for more code seperation.