added types to functions