converted to object oriented and fixed up bootstrap compatibility