merged and made some changes