changed bar128 to accept external input