Added beat function