created a reusable screencap method