makeApp function