added some unfinished functional code.