Updated to final solution