Updated function for setup