Added main class and click and drag functionality