added functools.wraps decorator to do all the fancy stuff when decorating function