fixed identation, added check to see if already exists hash