Reimplemented hugs (also fixed up number generator)