This function should probably have documentation. Also, what is the behavior if an invalid offset is requested... is there a chance this could recurse forever?