Adding comments and changing loop code to linq expression