changed around the function a bit to give info