solving a couple problems