removed function bet() and added header comments