fixed osher's code