finally think i got it right