Develops main fn