Moving sketch to JS