working code - works on smalltest and on basic ssd stuff