added prime, new constructor method, refactored a bit