Mix flour and salt in a bowl
Add eggs, sour cream, and water
Knead until smooth
Cover and let the dough rest
Boil potatoes until tender
Mash potatoes with butter, cheese, salt, and pepper
Cook onions in butter if desired
Roll out the dough thinly
Cut out circles with a glass or cutter
Place filling in the center of each circle
Fold the dough over the filling
Pinch the edges to seal
Boil the pierogi in salted water until they float
Remove and drain
Pan-fry in butter until golden if desired
Serve warm with sour cream or onions
