add in needed function, but has not make it nice