implemented task #1 => #7