Added further code for motor catching. Currently doesn't work properly.