working on card display window; cleaning up code