fixed bug, make the theoretical prediction and actual sample to scale
further develop to make it more robust and versetile