modified and completed (code modifications)