Modified the code for acquisition
changes to the file to improve data acquisition and to adapte to current need
merged