casting added to h1 and h2 method