Updated to preserve docstrings and function identities
functools wraps wasn't working. removed it.