Fixed right apply.
Refactored out unessary vars.