find largest streamid to initialize giles
remove unneeded lib