updated comments + minor bug fix