clarified somethings in the code