Improved constructor. NEED TO ADD HASH FUNCTION PARAM TO REG METHODS