an alternative method, almost working