Still debugging, mostly works.