Moved 'if' onto same line as 'else' as per request.