Complete main functions in app