made some changes
tested