refactored, and got is it prime working