This is modified Gappa++ 0.16 version