Practice problems from eloquent javascript ch 5