added bet function