Code written ready to test

coments have not been made still need to test code as well.