Working example also added missing libraries
Made some changes