Updated with function comments