ported to version 3