improved gold standard thanks to mhelvens and jmVillaveces #3, #8