working h_sync_gen file