basic working for rectangle and pie