Cleaned up code; removed testing code.