modify based on the previous code