Updated and extended Vlasis Pavlos.