Code for local reproduction