Working, not fully debugged.