made compatible with both IJ12 and 13 (by Vojtěch Krása)