added count hit function in main