fix some errors from the translation from 3-d to 1-d