Updated codeing style and missing function comments