refactored table to just be in form (not recursive)