some changes. still incomplete.