added chord function and resizable box