corrected terminator

had the \ the wrong way around
updated to correct bugs

mainly missed the () from the function when called in the loop.
Tidied the rest up