Made joblib dependency optional with simple for-loop as fallback