removed useless hat function