generalize for more screen sizes, add example program