implemented hadley style corrections and tried to make code more readable