made history be more bash-like (slightly more complex code...)