Imlemented screenshot function