Merge code for SPEAC program