Updated the uva11636 implementation