added coding and test code