add click/drag functionality on matrix