Berry handling improved plus new code functions