Fixed some formatting errors and put tests into a loop to allower quicker testing