adding parameter checks, stronger hashing, general cleanup, p1