Trying to solve B jennasue problem