Clean up, make toas a function