refactoring changes to beameff C - fall 2012