clean this up a bit
add history feature