added some helping couts