Fixed q3. tested on small example