The electrosensory lobe (ELL) in mormyrid electric fish is a cerebellar-like structure (also mushroom-body like) that cancels the sensory effects of self-generated electric fields, allowing prey to be detected. Like the cerebellum, the ELL involves two stages of processing, analogous to the Purkinje cells and output cells of the deep cerebellar nuclei. Through the work of Curtis Bell and others, a model was previously developed to describe the output stage of the ELL, but the role of the Purkinje-cell analogs, the medium ganglion (MG) cells, in the circuit had remained mysterious. I will present a complete circuit description of the ELL, developed in collaboration with Nate Sawtell and Salomon Muller, the reveals a novel role for the MG cells. The resulting model of ELL function relies on a principle of circuit organization based on the learning rather than the response properties of neurons that we have verified in the anatomy of the ELL.