rectangle and triangle works