added comments and trace to scripts