Implemented value/3 and within_frame/3, thanks to david garcia