Almost! I think there is one more simplification that can be made