updates to closures code