Implementing the setup function