more bytearay shenanigans, also made the discrete ifs into if elif else