add network option to data in function instead of repeating yourself