fixed some issues, added some options; still need to work on debugging