rearranged a few pieces of code to flow more smoothly during the demo