fixed indentation
removed the need for threading
cleanup
include cleanup