Added credit to orginal code