Added user object to buildpage function for ease of use.