library (allready modified a bit)