adjusted to fit new style for PHP code