normal speed bug fixed
tidied up some old code