Implemented distinct. Hopefully my last comit :)