made a couple modifications to make everything work