Added documenting function comments