Adding predict function