Ultra optimization alternate

This one only optimizes the "alternate" function.