moved main mehtod to junit test case. implemented todo in junit test case. also fixed a mistake.