Add solution to problem 3. Use glib