Closer to matching real functionality. Still got some terrible hacks to clean up.