Updated jguerin code from other repo