made script comments and structure a tad nicer