updated all the code