Fixed a bug
Switched to using tables