more efficiant code
update ui
show frequency information