changed make table function