redrawUnit function