mechanically working swilk function, but args are returning garbage