Fixed HTP  + simplified functions