cleaned up ungroup code a bit

preserve position of object when it is removed from a group