now it works, not finished yet