updated h_sync logic to trigger off clock, not next state