Added main which combines all Functionaly

also fixed graph