Updated files with comments and validation