all funtioning code