rewrite of capture
moved sails stuff to subfolder