added function returnAtEnd - to determine if a basic block terminates with