getting close to working properly