final with some changes