Add more code comments
Define missing function