Continued coding for v4.0.0-BETA
Updated for v4.1.1.