hrm. Some bugs to be fixed, but semi-working.