basic version
sol for q1