removed duplicate end definition