better mesh calculation