vanilla javascript version