complete "setup" function