The coordinate for the potential table was wrong. The wrong indexes were being used.