Working out some logic for the leason data