Comments and some changes, to make code more clean.