further updates to the code