R code: algorithms impl from s4 to s3
dont ask
dry the r code
fixes