An on/off lattice approach to protein structure prediction from contact maps