some refactoring and fixed #38
add gridlines for the xaxis