fixed string bug; removed unused code