fixed everything according to paper