implemented the first 3 tables