Added getuser function. Really need to refactor this a bit