Updated WSA functions with proper equations.