Updated code for version 2.4.