Solved one bug, but still incomplete.