He had been so busy getting away from the library, he hadn't paid attention to where he was going.
or simply: