Tried fixing ransum's code