beat function skeleton