Made some tweaks and changes from suggestions from Aaron and Neel