Created objects with functions for both rectangles and triangles