added some improvements and fixed some spelling errors