Fix a bug when doing [R y]
Add more algorithms