We found out those stupid equations at the waterfall were done by the Commander's son and they are him trying to find a way to make the portal go both ways. He has now apparently made it work and BAM that's the "cliffhanger" going into the season finale next week.