fix the algorithm in use to be consistent with best practices
updates based on feedback