Editted some part to debug