Cleaned up Adding functions

Used end to make array access easier.