Replaced exp with a hash lookup.
Don't need the cast to int.
Simple has not enough: need to factor out Jh and Jv.
Missing a minus.
Factored out exp to hash table. Need to test.