added each function to be jquery independent.