added all the functionality