using kacperus' branch