final app code