almost final version. http://www.lun.ua/ has more eficient functional