Solving for the value of k