fixed more bugs and added some programs for analysis