Program is almost working