Modified output slightly and added wrap variables