Updated with more simplifications