Added vg's code