Using and improving history.sh