implemented value checking and hash calculation