added in more type inference