Code cleaning, attempted fix