fixed implementation of table