New fixed version of apply.

Passes the tests now. Much better definition.
Fixed typo!