logic done just need to tweak for more general usability