swapDirection implemented

replaced swapNorth, swapEast, etc... with a single swapDirection method,
minor improvements