Improved block moving code