added all code so far