Made a few changes to this