finished code now to test