updated structur factor calculation