added pelin's code