implemented mouse input
improved mouse input; fixed bug with drag calculation