implementation of the Paper, done by Jiasen Lu and Yu Zhang