manual fitting added and R usage at the end