added methods and function closures