state function and chart
hahah
merge