added functions to the list code and added junit test