Updated setup function