replaced depricated push_char calls with push
replaced depricated fail! calls with panic