This is the very first feasible version of syncscan, need to manually switch the functions between scan and decoding in main file and recompile each time you modify it