added some logic

added some logic behind the windows form