This code is the working code for Rovina, it used bitwise operations and was commented, albeit possibly poorly.