some cleanup and comments
fix conflict