Casper vanilla

Fixed bug in sync_gen_init.m where counter as compared to SYNC_PERIOD rather than SYNC_PERIOD-2