convert to new sunmoon library