updated but needs more testing
saving changes; will add tests