Implemented two faster methods for #5