updated syntax and added type bounds, scope ownership issues remain