cleanup and function comments