fixed the hash access
no warnings now
cleaed up code