Nearly got the add function working