Fixed the functions what I know of them at least