added take photo function partially