Updated code to use modern syntax and dot notation.