Made the flash check into a method. Also made methods for preparing and releasing the camera.
Changed detetchFlash() from a boolean return type to a void method as the returned value was not being used.
Ammended some comments