simpler version with less error