added fields to windows
added generic function to write text on window