removed trailing whitespaces from predict function