naive and callback implementation