bug fixes, more comments