moved remaining code to the right place