code comments + bug fixes