Main 3sketch code