updating the whole code