code modified as per PSR-2