finished tail recursive list thing method w.e I'm late for class