this implementation should produce same results accross runs