Added button listerners, and fixed problem with drawing line.