minor bug fixes, added analysis script (WIP)