some changes
redesigned final version