changed some naming and optimized for use on site