Border detection and mouse drag added