separate opening and moving functions