Added new page swap code