modification after adding 3 tables