added objects for swapping and improved deletion mechanism