final_proj.pl add new logic with counts