updated foobar implementation