implementing the first idea