updated code and looekd for inconsistencies