Added legends on tables and coded validations