Implemented screen capture functionality