Made swap form with nested locations and js for origin