implemented counter in new GUI