Started adding structure factor generation