Extend the code for N-sites