Predicting spontaneity of reactions