Some updates to the code