First working version that's not insane.