some changes to the 'do everything and display it' function