Partial integration

Still need to connect photo buffer with state in encryption