did some updates to the code