added pic routing and functions