changed names; made code mroe readable