We are developing a computationally efficient design algorithm for nanophotonic structures, which we call "objective-first design". Instead of optimizing a design objective while satisfying Maxwell's equations, objective-first design forces the design objective to always be met, and then attempts to modify the electromagnetic fields and structure in order to satisfy Maxwell's equation. Using this strategy we have successfully designed both nanophotonic resonators and waveguide couplers.