char temp == '|' may be more readable?