implemented argument swapping