finally all this stuff works