worked on screenshot function