Improved code: modified PHPDoc , added annotations, etc.