this is really a mess code, but the code could run well and generate a
sin curve for the monitor.
but in the coming, the code need to be refacted to make a clean code