updated, now working