renaming scripts, fixing some bugs