private void sortMonsters(int low, int high) 
	{
		int i = low;
		int j = high;
		
		Monster pivot = monsters.get(low + (high-low)/2);
		float pivotDistance = pivot.getTransform().getPosition().sub(Transform.getCamera().getPos()).length();

		while (i <= j) 
		{
			while (monsters.get(i).getTransform().getPosition().sub(Transform.getCamera().getPos()).length() > pivotDistance) 
			{
		        i++;
		    }
			while (monsters.get(j).getTransform().getPosition().sub(Transform.getCamera().getPos()).length() < pivotDistance) 
		    {
				j--;
		    }

			if (i <= j) 
			{
				Monster temp = monsters.get(i);
				
				monsters.set(i, monsters.get(j));
				monsters.set(j, temp);

				i++;
				j--;
			}
		}

		if (low < j)
			sortMonsters(low, j);
		if (i < high)
			sortMonsters(i, high);
	}