Added swapClass method and other minor edits