changed things to be more comparable with python version