Added function autoCrop closes #2