partially done with swap mode