Adding comments and cleanup