create but comment out debugging functions
create a generic function for inserting buttons
idle buffer cleanup and improvements (added dual-transfer and restore)