table code added, not working due to undefined function