new target prelude copied from Baysig