fixed typo. added some functionality