Custody terms can depend on substance abuse and other issues