added functions and temporisation of shadow change