fixed Brian's errors