Code clean up. Finishing some partial implmented code that has been hanging around.