A code to aid the optimisation of lattice design