implemented logic for first test