added read input funktion and combiened with compute()