Partially debugged.