Cleaned up lib/custom.php