some slight adjustments with the code