migrated jwray's code into valkyrie for jide docking