Added validation in tip classes and added some more comments.