Implementation of ruby cal