imporved by adding tab function