Added different implementation using map and anon.