minor bug fixes and in code documentation added