Fixed kari's Code