Wrote application functions