add all the relevant parts from my laser branch to edge