Just updated based on mrBears wonderful work