Fixed swap code bugs, stylized it, added swap to makefile