move int array swap into own class, make use of that class, fix indenting slightly