swap declarations added and tested