diff --git a/pom.xml b/pom.xml
index a3464194e11d8ff05f706209219b18b253d9ed34..06892d2448f4c318680774c61cb5e5663a42cfe8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,19 +8,19 @@
 	<packaging>jar</packaging>
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<maven.compiler.source>11</maven.compiler.source>
-		<maven.compiler.target>11</maven.compiler.target>
+		<maven.compiler.source>17</maven.compiler.source>
+		<maven.compiler.target>17</maven.compiler.target>
 	</properties>
 	<dependencies>
 		<dependency>
 			<groupId>org.openjfx</groupId>
 			<artifactId>javafx-controls</artifactId>
-			<version>11</version>
+			<version>17.0.2</version>
 		</dependency>
 		<dependency>
 			<groupId>org.openjfx</groupId>
 			<artifactId>javafx-fxml</artifactId>
-			<version>11</version>
+			<version>17.0.2</version>
 		</dependency>
 		<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
 		<dependency>
diff --git a/src/main/java/lab/App.java b/src/main/java/lab/App.java
index 8ff008222441aad07767de774c6e784dfa618657..858f494ea68643a708625dc0e76b610390f7ee6d 100644
--- a/src/main/java/lab/App.java
+++ b/src/main/java/lab/App.java
@@ -1,7 +1,7 @@
 package lab;
 
+import javafx.animation.AnimationTimer;
 import javafx.application.Application;
-import javafx.application.Platform;
 import javafx.scene.Group;
 import javafx.scene.Scene;
 import javafx.scene.canvas.Canvas;
@@ -20,6 +20,7 @@ public class App extends Application {
 	}
 	
 	private Canvas canvas;
+	private AnimationTimer timer;
 	
 	@Override
 	public void start(Stage primaryStage) {
@@ -37,25 +38,19 @@ public class App extends Application {
 			
 			//Exit program when main window is closed
 			primaryStage.setOnCloseRequest(this::exitProgram);
-			
-			//Draw scene on a separate thread to avoid blocking UI.
-			new Thread(this::drawScene).start();
+			//graphic context is used for a painting
+			GraphicsContext gc = canvas.getGraphicsContext2D();
+		
+			timer = new DrawingThread(gc);
+			timer.start();
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
 	}
-	
-	/**
-	 * Draws objects into the canvas. Put you code here. 
-	 *
-	 *@return      nothing
-	 */
-	private void drawScene() {
-		//graphic context is used for a painting
-		GraphicsContext gc = canvas.getGraphicsContext2D();
-		// put your code here
-		// gc.setFill(Color.AQUA);
-		// gc.setStroke(Color.BLACK);
+	@Override
+	public void stop() throws Exception {
+		timer.stop();
+		super.stop();
 	}
 	
 	private void exitProgram(WindowEvent evt) {
diff --git a/src/main/java/lab/DrawingThread.java b/src/main/java/lab/DrawingThread.java
new file mode 100644
index 0000000000000000000000000000000000000000..5d52cfdd469e9b8b6099dd03a91e8439dd35f4e1
--- /dev/null
+++ b/src/main/java/lab/DrawingThread.java
@@ -0,0 +1,27 @@
+package lab;
+
+import javafx.animation.AnimationTimer;
+import javafx.scene.canvas.GraphicsContext;
+import javafx.scene.paint.Color;
+
+public class DrawingThread extends AnimationTimer {
+
+	private final GraphicsContext gc;
+
+	public DrawingThread(GraphicsContext gc) {
+		this.gc = gc;
+	}
+
+	/**
+	  * Draws objects into the canvas. Put you code here. 
+	 */
+	@Override
+	public void handle(long now) {
+		// put your code here
+		gc.setFill(Color.AQUA);
+		gc.setStroke(Color.BLACK);
+		gc.fillOval(10, 10, 20, 20);
+
+	}
+
+}
diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java
index 7006c78362486c4b03983ff6ea1321d95ca1ed40..736971c46e3a0601a2db674231080b0e8f886cc0 100644
--- a/src/main/java/module-info.java
+++ b/src/main/java/module-info.java
@@ -1,6 +1,7 @@
 module lab01 {
     requires transitive javafx.controls;
     requires javafx.fxml;
+    requires javafx.base;
     opens lab to javafx.fxml;
     exports lab;
 }
\ No newline at end of file