Fixed average, added branch and extendDown
Added extendUp
Added before, stack. Fixed formatting on andThen, fixed extendUp