added mousedown and mouseup functions