swapped i and j in 176
Scaling issue needs to be fixed.