turned h into a function with default app