added inline documentation, updated to PSR2