added base_alphabet parameter everywhere