RYAN: changed implementation