Mode Implementation

Sorry for the multiple commits, but here's a mode implementation. I'm not sure about pulling in another import, but it is the simplest I could come up with.