some other tries to implement it correctly