Scripts revised

Updated some scripts. Not perfect yet, though.