updating the code after quite awhile