work neraly finished need debug