REAL refactored version...