fixed up comments. optimized