Some changes to the final code