corrected functionality and tehming
corrected functionality