modified version from SPIKA APP