adding function takePhoto