A few changes and updates to the code