named function for constructor rather than assigned variable to anonymous function