added docking and docking logic