added variable width outside the function