Added record function.