equation reference mixed up