Writing and solving equations from story problems