cleanup and giving the hi as parameter instead of uploaded array