Added todo; bug fixes