edited with some changes