stack swapping implemented in gui