Re-arrange functiontest input loops