refactor
change end point judgement
debug info
add to string method
change scale factor
submean not needed for client code
move turn to log into fram