First-pass implementation