another possible race
remove some magic numbers
moving things about
a bit safer