code tidyup

tidied up the code, it looks nicer now.