fixing Kay's experimental code.