v1.0.0 - completely refactored with test cases