works so far, now refactor it