changed program a bit so that it works for me too