Updated the singin function.