reorg shared files, minor fixes to lab5 and lab8 files