Updated code to a (hopefully) working version of DOCK.