Changing from vectors to tables