updated mouse code