basic implementation using glib