fixed functionality, now does same as example