Storing history of buttons pressed