Code working almost, something wrong with soleForH function