fixed a bug, improved granularity, cleaned up the code

When removing the shapes from last ellipse drawing the last two shapes
used to remain on the map. the array of shape is modified to fix this.