main fn integration