Added some comments, optimized data validation