complete the table placing algorithm