added some functionality and a testing file