Completed all the TO DO's.
Still needs testing and commenting.