Added scale code.
Added more scale testing. There is still a bug.