Update code: Implement some functions